package structdef

import "fmt"

type BehaviorDefinition struct {
	//行为所属的类型
	TypeName string
	// 行为名
	BehaviorName string
	// 行为体
	Body []LineCodeDefinition
	//方法注解
	Annotations map[string]map[string]string
}

// 从写ToString方法
func (f BehaviorDefinition) String() string {
	return fmt.Sprintf("[所属类型:%s,行为名称:%s,行为体:%s,行为注解:%s]", f.TypeName, f.BehaviorName, f.Body, f.Annotations)
}

// 创建函数定义
func NewBehaviorDefinition(typeName, behaviorName string, body []LineCodeDefinition, annotations map[string]map[string]string) BehaviorDefinition {
	return BehaviorDefinition{TypeName: typeName, BehaviorName: behaviorName, Body: body, Annotations: annotations}
}
